home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / mint / lib / mntlib44.zoo / mntlib / seekdir.c < prev    next >
C/C++ Source or Header  |  1994-03-01  |  479b  |  29 lines

  1. /* seekdir routine */
  2.  
  3. /* under MiNT (v0.9 or better) these use the appropriate system calls.
  4.  * under TOS or older versions of MiNT, they use Fsfirst/Fsnext
  5.  *
  6.  * Written by Eric R. Smith and placed in the public domain
  7.  */
  8.  
  9. #include <types.h>
  10. #include <limits.h>
  11. #include <dirent.h>
  12. #include "lib.h"
  13.  
  14. extern int __mint;
  15.  
  16. /* not POSIX */
  17.  
  18. void
  19. seekdir(dirp, loc)
  20.     DIR *dirp;
  21.     off_t loc;
  22. {
  23.     rewinddir(dirp);
  24.     while (dirp->buf.d_off != loc) {
  25.         if (!readdir(dirp))
  26.             break;
  27.     }
  28. }
  29.